/***********************************************************************************
*	File: Game.h
*	Author: Keisuke Miyazaki
*	Project: Straw Man
*	Date: 09/13/2013
***********************************************************************************/
#ifndef GAME_H_
#define GAME_H_

#define WIN32_LEAN_AND_MEAN
#include <Windows.h>

enum LANGUAGE { ENGLISH = 0, JAPANESE = 1 };

class CSGD_Direct3D;
class CSGD_DirectInput;
class CSGD_TextureManager;
class CSGD_XAudio2;
class CSGD_MessageSystem;
class CSGD_EventSystem;
class IMessage;

class IGameState;

class CGame
{
public:
	static CGame* GetInstance( void );
	static void DeleteInstance( void );

	void Initialize( HWND hWnd, HINSTANCE hInstance,
		int nWidth, int nHeight,
		bool bIsWindowed );

	bool Status( void );

	void Terminate( void );

	int GetScreenWidth	( void ) const	{	return m_nScreenWidth;	}
	int GetScreenHeight	( void ) const	{	return m_nScreenHeight;	}
	
	void ChangeState( IGameState* pState );
	void SwapState( IGameState* pState );

	void WindowedMode( void ) { m_bIsWindowed = !m_bIsWindowed; }
	void SetWindowed( bool _windowed )  { m_bIsWindowed = _windowed; }
	bool GetWindowedMode( void ) const { return m_bIsWindowed; }

	void SetInGame( bool bGame ) { m_bInGame = bGame; }
	bool GetInGame( void ) const { return m_bInGame; }


	LANGUAGE GetLanguage( void ) const		{ return m_eLanguage;		}
	void SetLanguage( LANGUAGE _Language )  { m_eLanguage = _Language;	}
	

private:
	static CGame* s_pInstance;

	CGame( void );						
	~CGame( void ){}			
	CGame( const CGame& );				
	CGame& operator= ( const CGame& );

	bool Input( void );
	void Update( void );
	void Render( void );

#pragma region Window Attributes

	int						m_nScreenWidth;
	int						m_nScreenHeight;
	bool					m_bIsWindowed;
	bool					m_bInGame;

#pragma endregion

#pragma region SGD Wrappers

	CSGD_Direct3D*			m_pD3D;
	CSGD_DirectInput*		m_pDI;
	CSGD_TextureManager*	m_pTM;
	CSGD_XAudio2*			m_pXA;

#pragma endregion



	IGameState*				m_pCurrentState;
	DWORD					m_dwCurrTime;

	LANGUAGE				m_eLanguage;
};

#endif //GAME_H_